package com.example.demo.lock;


public interface RedisLock {

    /**
     * 进行加锁(非阻塞)
     * @param lockValue lock value
     * @param seconds expire time
     * @return get lock
     */
    boolean lock(String lockValue, int seconds);

    /**
     * 进行加锁(阻塞)
     * @param lockValue lock value
     * @param seconds expire time
     * @return get lock
     */
    boolean tryLock(String lockValue, int seconds);

    /**
     * 释放锁,注意lua脚本不支持Integer，要用Long
     * @param lock lock value
     * @return release lock
     */
    boolean release(String lock);
}
